//
// Created by v on 19-6-25.
//

#ifndef JKLIBS_CMDATABASESQLITE_H
#define JKLIBS_CMDATABASESQLITE_H

#include "CMDatabaseBase.h"

#include "sqlite3.h"

class CMDatabaseSqlite : public CMDatabaseBase
{
  public:
    explicit CMDatabaseSqlite(const char *dbfile);
    virtual ~CMDatabaseSqlite();

    int dbConnect() override;

    int dbDisconnect() override;

    int dbQuery(const char *sql, CMDatabaseResult &result) override;

    int dbQueryResult(const char *sql, CMDatabaseResult &result) override;

  private:
    int dbGetLock(int ms);

  private:
    sqlite3 *m_handler;
};

#endif // JKLIBS_CMDATABASESQLITE_H
